package com.linewell.license.demo.controller;

import com.linewell.license.demo.constants.AipVersionConstant;
import com.linewell.license.demo.utils.CurrentRequestUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cjianbin
 * Company:
 * Createtime : 2019/10/9 0009 下午 2:02
 * Description :
 */

@Api(tags = {"登录相关接口"})
@RestController
@RequestMapping(AipVersionConstant.API + AipVersionConstant.API_VERSION_01 + "/index")
public class IndexController {

    @ApiOperation("获取当前登录者登录名")
    @RequestMapping(value = "/getLoginName" ,method = RequestMethod.GET)
    public String getLoginName(){
        return CurrentRequestUtils.getLoginInfo().getUserName();
    }
}
